import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15

ApplicationWindow {
    id: root
    width: Screen.width > 1000 ? 1800 : 1600
    height: Screen.height > 1000 ? 1400 : 1200
    visible: true
    title: "HeatMap"
    
    // 根据屏幕大小计算缩放因子
    readonly property real scaleFactor: width > 1000 ? 1.5 : 1.2
    
    ColumnLayout {
        anchors.fill: parent
        spacing: 10 * scaleFactor
        
        // 控制栏
        RowLayout {
            Layout.fillWidth: true
            Layout.margins: 10 * scaleFactor
            
            Text {
                text: "Radius:"
                font.pixelSize: 20 * scaleFactor
            }
            
            SpinBox {
                id: radiusSpinBox
                from: 10
                to: 300
                value: 80
                font.pixelSize: 18 * scaleFactor
            }
            
            Item {
                Layout.fillWidth: true
            }
            
            Button {
                text: "Clear"
                font.pixelSize: 18 * scaleFactor
                Layout.preferredWidth: 100 * scaleFactor
                Layout.preferredHeight: 40 * scaleFactor
                onClicked: {
                    heatMap.clear()
                }
            }
        }
        
        // 热力图组件
        HeatMap {
            id: heatMap
            Layout.fillWidth: true
            Layout.fillHeight: true
            radius: radiusSpinBox.value
        }
    }
}
